# from django.urls import path
# from apps.recruit import views
#
#
# urlpatterns = [
#     # 获取所有推荐的招聘信息列表
#     path('recruits/search/recommend/', views.SearchRecommendView.as_view()),
#     # 获取最新的招聘信息列表
#     path('recruits/search/latest/',views.SearchLatestView.as_view()),
#     # 获取热门企业列表
#     path('enterprise/search/hotlist/', views.SearchHotlistView.as_view()),
#     # 获取热门城市
#     path('city/hotlist/', views.CityHotlistView.as_view()),
#     # 搜索某个职位
#     path('recruits/search/city/keyword/', views.SearchCityKeywordView.as_view()),
#     # 获取职位详情信息
#     path('recruits/<int:pk>/', views.RecruitIDView.as_view()),
#     # 增加某个职位的访问量
#     path('recruits/<int:pk>/visit/', views.RecruitIDVisitView.as_view()),
#     # 收藏职位
#     path('recruits/<int:pk>/collect/', views.RecruitIDCollectView.as_view()),
#     # 取消收藏职位
#     path('recruits/<int:pk>/cancelcollect/', views.RecruitIDCollectsView.as_view()),
#     # 获取企业详情信息
#     path('enterprise/<int:pk>/', views.EnterpriseIDView.as_view()),
#     # 增加企业的访问量
#     path('enterprise/<int:pk>/visit/', views.EnterpriseIDVisitView.as_view()),
#     # 收藏公司,后台会自行动态判断
#     path('enterprise/<int:pk>/collect/', views.EnterpriseIDCollect.as_view()),
#     # 取消收藏公司,后台会自行动态判断
#     path('enterprise/<int:pk>/cancelcollect/', views.EnterpriseIDCollects.as_view()),
# ]

from django.urls import path
from . import views

from rest_framework.routers import SimpleRouter

urlpatterns = [
    # 职位推荐
    path('recruits/search/recommend/',views.RecommendView.as_view()),
    # 最新职业
    path('recruits/search/latest/',views.LatestJobView.as_view()),
    # 热门企业
    path('enterprise/search/hotlist/',views.HotlistView.as_view()),
    # 热门城市
    path('city/hotlist/',views.HotCityView.as_view()),
    # 搜索职位
    path('recruits/search/city/keyword/',views.SerachJobView.as_view()),
    # 取消收藏职位
    path('recruits/<int:pk>/cancelcollect/',views.CancelJobView.as_view()),
    # 取消公司收藏
    path('enterprise/<int:pk>/cancelcollect/',views.CancelEnterpriseView.as_view()),


]

router = SimpleRouter()
# ② 注册视图集
router.register('recruits', views.PositionView, basename='recruits')
router.register('enterprise',views.EnterpriseView, basename='enterprise')
# ③ 添加url配置
urlpatterns += router.urls

